extends Fader

#var MONTH_SIZE = 20
#var TITLE_SIZE = 30

var MONTH_SIZE = 30
var TITLE_SIZE = 40

#var titlefont_path = "res://fonts/Now FL/Now-Regular.otf"
#var bold_titlefont_path = "res://fonts/Now FL/Now-SemiBold.otf"

#var titlefont_path = "res://fonts/luculent/luculent.ttf"
#var bold_titlefont_path = "res://fonts/luculent/luculentb.ttf"

#var titlefont_path = "res://fonts/Avara-master/Avara.otf"
#var bold_titlefont_path = "res://fonts/Avara-master/Avara.otf"

#var titlefont_path = "res://fonts/Sansita-for-Print/Sansita-Regular.otf"
#var bold_titlefont_path = "res://fonts/Sansita-for-Print/Sansita-Bold.otf"

#var titlefont_path = "res://fonts/Subotype Steady.otf"
#var bold_titlefont_path = "res://fonts/Subotype Steady.otf"

var titlefont_path = "res://fonts/HiLo-Deco.ttf"
var bold_titlefont_path = "res://fonts/HiLo-Deco.ttf"

var titlefont = DynamicFont.new()
var bold_titlefont = DynamicFont.new()


var month = "April"
var month_label = null

var title = "PLP's Sadness"
var title_label = null

func _init():
	var titlefont_data=DynamicFontData.new()
	titlefont_data.font_path = titlefont_path
	titlefont.font_data=titlefont_data
	titlefont.size=MONTH_SIZE

	var bold_titlefont_data=DynamicFontData.new()
	bold_titlefont_data.font_path = bold_titlefont_path
	bold_titlefont.font_data=bold_titlefont_data
	bold_titlefont.size=TITLE_SIZE




func make_central_label(text,font):
	var res = Label.new()
	res.add_font_override("font",font)
	res.add_color_override("font_color",ColorN("white"))
	res.text = text
	res.rect_size.x = get_viewport().size.x
	res.align = Label.ALIGN_CENTER
	res.valign = Label.VALIGN_CENTER
	add_child(res)
	return res

func make_title(month,title):
	var INTERROW_DIST = 40

	for l in [month_label,title_label]:
		if l:
			l.queue_free()

	month_label = make_central_label(month+":", titlefont)
	month_label.rect_position.y = get_viewport().size.y/2 - INTERROW_DIST/2

	title_label = make_central_label(title, bold_titlefont)
	title_label.rect_position.y = get_viewport().size.y/2 + INTERROW_DIST/2

func _ready():
	pass
#	make_title()
#	fade_out()
